using UnityEngine;
using System.Collections;

public class ObservPlayerBehaviour : MonoBehaviour {

    public float radius = 4;
    public float angle = 30;

    private PatrolBehaviour patrolBehaviour;

	// Use this for initialization
	void Start () {
        this.patrolBehaviour = this.gameObject.GetComponent<PatrolBehaviour>();
	}
	
	// Update is called once per frame
	void Update () {
        if (this.patrolBehaviour == null)
        {
            return;
        }

        Vector3 direction = this.gameObject.transform.position + this.patrolBehaviour.direction * radius;
        Vector3 top = new Vector3(0, Mathf.Tan(Mathf.Deg2Rad * this.angle) * this.patrolBehaviour.direction.x, 0);

        Debug.DrawLine(this.gameObject.transform.position, direction + top, Color.green);
        Debug.DrawLine(this.gameObject.transform.position, direction - top, Color.green);
	}
}
